Concrete stream calculus: An extended study

نویسنده

  • Ralf Hinze
چکیده

This paper shows how to reason about streams concisely and precisely. Streams, infinite sequences of elements, live in a coworld: they are given by a coinductive datatype, operations on streams are implemented by corecursive programs, and proofs are typically concocted using coinduction. This paper offers an alternative to coinduction. Suitably restricted, stream equations possess unique solutions. This property gives rise to a simple and attractive proof technique, essentially bringing equational reasoning to the coworld. We redevelop the theory of recurrences, finite calculus and generating functions using streams and stream operators, building on the cornerstone of unique solutions. The paper contains a smörgåsbord of examples: we study recursion elimination, investigate the binary carry sequence, explore Sprague-Grundy numbers and present two proofs of Moessner's Theorem. The calculations benefit from the rich structure of streams. As the type of streams is an applicative functor we can effortlessly lift operations and their properties to streams. In combination with Haskell's facilities for overloading, this greatly contributes to conciseness of notation. The development is indeed constructive: streams and stream operators are implemented in Haskell, usually by one-liners. The resulting calculus or library, if you wish, is elegant and fun to use.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Sampling, Splitting and Merging in Coinductive Stream Calculus

We study various operations for partitioning, projecting and merging streams of data. These operations are motivated by their use in dataflow programming and the stream processing languages. We use the framework of stream calculus and stream circuits for defining and proving properties of such operations using behavioural differential equations and coinduction proof principles. We study the inv...

متن کامل

Stream Differential Equations: concrete formats for coinductive definitions

In this article we give an accessible introduction to stream differential equations, ie., equations that take the shape of differential equations from analysis and that are used to define infinite streams. Furthermore we discuss a syntactic format for stream differential equations that ensures that any system of equations that fits into the format has a unique solution. It turns out that the st...

متن کامل

Typing streams in the Λμ-calculus: extended abstract

Λμ-calculus [11] has been built as an untyped extension of the λμ-calculus [10] in order to recover Böhm theorem which was known to fail in λμ-calculus since a result by David & Py [2]. An essential computational feature of Λμ-calculus for separation to hold is the unrestricted use of abstractions over continuation variables that provides the calculus with a construction of streams. In [11], Λμ...

متن کامل

The Differential Calculus of Bitstreams ( extended

CWI's research has a theme-oriented structure and is grouped into four clusters. Listed below are the names of the clusters and in parentheses their acronyms. The Differential Calculus of Bitstreams (extended abstract) ABSTRACT Using (stream) differential equations for definitions and coinduction for proofs, we define, analyse, and relate in a uniform way four different algebraic structures on ...

متن کامل

Push-over analysis of concrete gravity dams due to flood inflow

This study numerically predicts the failure scenario of a cracked concrete gravity dam through a push-over nonlinear analysis. The mixed-mode Linear Elastic Fracture Mechanics (LEFM) was employed using the extended finite element method (XFEM). The dam base was considered to be fully fixed without any foundation effects. The hydrostatic pressure on the dam's upstream face was increased incremen...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • J. Funct. Program.

دوره 20  شماره 

صفحات  -

تاریخ انتشار 2008